<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>新浪微博缘份计算器 - Powered by 煊煊</title>
	<link href="style/main.css" rel="stylesheet" type="text/css"></link>
	<script type="text/javascript" src="js/jquery.js"></script>
	<script type="text/javascript">
	jQuery.fn.extend({
		post_data : function(callback)
		{
			var $formobj = $(this);
			$.ajax({
				type	: "POST",
				dataType: "json",
				url		: $formobj.attr("action"),
				data	: $formobj.serialize(),
				success	: callback
			});
			return false;
		}
	});
	
	//计算缘份的方法
	function compute(formobj)
	{
		$("#loading").show();
		$("#result").hide();
		return $(formobj).post_data(function(o){
			$("#loading").hide();
	
			if(o.success)
			{
				$("#person").html(o.result.nick).attr("href", "http://t.sina.com.cn/"+o.result.uid);
				$("#val").html(o.result.val);
				$("#result").show();
			}
			else
			{
				alert(o.message);
			}
		});
	}
	
	
	</script>
</head>


<body>
	<div class="center">
		<a href="./"><img id="logo" src="./images/logo.png" alt="LOGO" /></a>
	</div>

	<div class="content compute">
		<h3>我的昵称：<?= $me['screen_name'] ?></h3>
		<form class="form_basic" method="post" action="compute.php?action=getdata" onsubmit="return compute(this)">

			<div>
				<dl>
					<dt>对方的微博昵称</dt>
					<dd><input type="text" name="nick" /></dd>
				</dl>
				<dl>
					<dt><label for="send_mblog">同时发一条微博</label></dt>
					<dd><input type="checkbox" id="send_mblog" name="send_mblog" value="1" checked="checked" /></dd>
				</dl>
			</div>

			<div class="clear"></div>
			<div class="center"><input type="image" src="./images/start.jpg" /></div>

		</form>

		<div id="loading" class="hide">计算中...</div>

		<div id="result" class="hide">
			<p id="content">经过计算机精密的计算，你与 <a id="person" target="_blank" href=""></a> 之间的缘份值为<span id="val"></span></p>
		</div>
	</div>
</body>
</html>